package org.aplombh.java.interview.newcoder;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class HJ60_查找组成一个偶数最接近的两个素数 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();

        int mid = n / 2;
        int l = mid ;
        int r = mid ;

        while (l > 1 && r < n) {
            if (primeNumber(l) && (primeNumber(r))) {
                System.out.println(l);
                System.out.println(r);
                break;
            }
            l--;
            r++;
        }
    }

    public static boolean primeNumber(int p) {
        for (int i = 2; i <= p / 2; i++) {
            if (p % i == 0)
                return false;
        }
        return true;
    }
}